home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1993…ch: Other People's Memory / ADC Developer CD (1993-03) (''Other People's Memory'')_iso / Dev.CD Mar 93.iso / Technical Documentation / Sample Code / DTS.Lib & Samples / DTS.Draw / TRootObj.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-10-22  |  1.5 KB  |  89 lines  |  [TEXT/MPS ]

  1. /*
  2. ** Apple Macintosh Developer Technical Support
  3. **
  4. ** File:        TRootObj.c
  5. ** Written by:    Eric Soldan
  6. **
  7. ** Copyright © 1992 Apple Computer, Inc.
  8. ** All rights reserved.
  9. */
  10.  
  11. /* See the files "=How to write your app" and "=Using TreeObj.c" for information
  12. ** on this function. */
  13.  
  14.  
  15.  
  16. /*****************************************************************************/
  17.  
  18.  
  19.  
  20. #include "App.h"            /* Get the application includes/typedefs, etc.    */
  21. #include "App.Common.h"        /* Get the stuff in common with rez.            */
  22. #include "App.protos.h"        /* Get the prototypes for the application.        */
  23.  
  24. #ifndef __OSEVENTS__
  25. #include <OSEvents.h>
  26. #endif
  27.  
  28. #ifndef __OSUTILS__
  29. #include <OSUtils.h>
  30. #endif
  31.  
  32. #ifndef __QUICKDRAW__
  33. #include <Quickdraw.h>
  34. #endif
  35.  
  36. #ifndef __STRING__
  37. #include <String.h>
  38. #endif
  39.  
  40. #ifndef __TREEOBJ2__
  41. #include "TreeObj2.h"
  42. #endif
  43.  
  44. #ifndef __UTILITIES__
  45. #include "Utilities.h"
  46. #endif
  47.  
  48.  
  49.  
  50. #pragma segment DrawObjects
  51. long    TRootObj(TreeObjHndl hndl, short message, long data)
  52. {
  53.     short    fileRefNum;
  54.     char    *cptr;
  55.  
  56.     switch (message) {
  57.         case FREADMESSAGE:
  58.             fileRefNum = data;
  59.             return(ReadTreeObjData(hndl, fileRefNum));
  60.             break;
  61.  
  62.         case FWRITEMESSAGE:
  63.             fileRefNum = data;
  64.             return(WriteTreeObjData(hndl, fileRefNum));
  65.             break;
  66.  
  67.         case VHMESSAGE:
  68. #if VH_VERSION
  69.             cptr = ((VHFormatDataPtr)data)->data;
  70.             ccatchr(cptr, 13, 2);
  71.             VHRootInfo(hndl, cptr);
  72.             ccat   (cptr, "  $08: numSelected = ");
  73.             ccatdec(cptr, mDerefRoot(hndl)->numSelected);
  74.             ccatchr(cptr, 13, 2);
  75.             VHFileRecInfo(hndl, cptr);
  76.             return(true);
  77. #endif
  78.             break;
  79.  
  80.         default:
  81.             break;
  82.     }
  83.  
  84.     return(noErr);
  85. }
  86.  
  87.  
  88.  
  89.